package com.hytc.mymall.pager;

import android.content.Context;
import android.widget.TextView;

import com.hytc.mymall.R;
import com.hytc.mymall.base.BasePager;
import com.hytc.mymall.bean.HomeInfoBean;
import com.hytc.mymall.utils.BaseTools;

import java.math.BigDecimal;
import java.util.List;

/**
 * Created by Administrator on 2016/12/1.
 */

public class pager2 extends BasePager
{
    private TextView tv_12amount;
    private TextView tv_24amount;
    private TextView tv_6amount;

    public pager2(final Context context, final int n, final HomeInfoBean.HomeInfo homeInfo) {
        super(context, n, homeInfo);
    }

    @Override
    public void initData() {
        super.initData();
        final List<HomeInfoBean.Home1> home1 = this.homeinfo.home1;
        if (home1 == null || home1.size() <= 0) {
            return;
        }
        try {
            this.tv_6amount.setText((CharSequence)(String.valueOf(BaseTools.formatMoney(new BigDecimal(home1.get(0).amount))) + "元"));
            this.tv_12amount.setText((CharSequence)(String.valueOf(BaseTools.formatMoney(new BigDecimal(home1.get(1).amount))) + "元"));
            this.tv_24amount.setText((CharSequence)(String.valueOf(BaseTools.formatMoney(new BigDecimal(home1.get(2).amount))) + "元"));
        }
        catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    @Override
    public void initView() {
        super.initView();
        this.tv_6amount = (TextView)this.rootView.findViewById(R.id.tv_page2_6amount);
        this.tv_12amount = (TextView)this.rootView.findViewById(R.id.tv_page2_12amount);
        this.tv_24amount = (TextView)this.rootView.findViewById(R.id.tv_page2_24amount);
    }
}

